'\" te
.\" Copyright 2015 Nexenta Systems Inc.
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH INSTALLGRUB 8 "Jan 14, 2015"
.SH NAME
installgrub \- install GRUB in a disk partition or a floppy
.SH SYNOPSIS
.LP
.nf
\fB/sbin/installgrub\fR [\fB-fm\fR] \fIstage1\fR \fIstage2\fR \fIraw-device\fR
.fi

.SH DESCRIPTION
.LP
The \fBinstallgrub\fR command is an x86-only program. GRUB stands for GRand
Unified Bootloader.
.sp
.LP
\fBinstallgrub\fR installs GRUB stage 1 and stage 2 files on the boot area of a
disk partition. If you specify the \fB-m\fR option, \fBinstallgrub\fR installs
the stage 1 file on the master boot sector of the disk.
.SH OPTIONS
.LP
The \fBinstallgrub\fR command accepts the following options:
.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.RS 6n
Suppresses interaction when overwriting the master boot sector.
.RE

.sp
.ne 2
.na
\fB\fB-m\fR\fR
.ad
.RS 6n
Installs GRUB \fIstage1\fR on the master boot sector interactively. You must
use this option if Solaris is installed on an extended FDISK or an EFI/GPT
partition.
.RE

.SH OPERANDS
.LP
The \fBinstallgrub\fR command accepts the following operands:
.sp
.ne 2
.na
\fB\fIstage1\fR\fR
.ad
.RS 14n
The name of the GRUB stage 1 file.
.RE

.sp
.ne 2
.na
\fB\fIstage2\fR\fR
.ad
.RS 14n
The name of the GRUB stage 2 file.
.RE

.sp
.ne 2
.na
\fB\fIraw-device\fR\fR
.ad
.RS 14n
The name of the device onto which GRUB code is to be installed. It must be a
character device that is readable and writable. For disk devices, specify the
slice where the GRUB menu file is located. (For Solaris it is the root slice.)
For a floppy disk, it is \fB/dev/rdiskette\fR.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRInstalling GRUB on a Hard Disk Slice
.sp
.LP
The following command installs GRUB on a system where the root slice is
\fBc0d0s0\fR:

.sp
.in +2
.nf
example# /sbin/installgrub /boot/grub/stage1 \e
         /boot/grub/stage2 /dev/rdsk/c0d0s0
.fi
.in -2

.LP
\fBExample 2 \fRInstalling GRUB on a Floppy
.sp
.LP
The following command installs GRUB on a formatted floppy:

.sp
.in +2
.nf
example# mount -F pcfs /dev/diskette /mnt
# mkdir -p /mnt/boot/grub
# cp /boot/grub/* /mnt/boot/grub
# umount /mnt
# cd /boot/grub
# /sbin/installgrub stage1 stage2 /dev/rdiskette
.fi
.in -2

.SH FILES
.ne 2
.na
\fB\fB/boot/grub\fR\fR
.ad
.RS 14n
Directory where GRUB files reside.
.RE

.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Uncommitted
.TE

.SH SEE ALSO
.LP
.BR attributes (7),
.BR boot (8),
.BR fdisk (8),
.BR fmthard (8),
.BR kernel (8)
.SH WARNINGS
.LP
Installing GRUB on the master boot sector (\fB-m\fR option) overrides any boot
manager currently installed on the machine. The system will always boot the
GRUB in the Solaris partition regardless of which \fBfdisk\fR partition is
active.
